import Vue from 'vue'
import Router from 'vue-router'
import Config from '../js/config'
import Account from './account'
import Home from './home'


Vue.use(Router)

export default new Router({
  routes: [
    /* 账号相关 */
    ...Account,
    {
      path: '/',
      component: () => import('../components/LayoutTwo.vue'),
      meta: { title: `${Config.title}` },
      redirect: '/account/login',
      children: [
        /* 首页 */
        ...Home
      ]
    },
    {
      path: '/404',
      component: resolve => require(['../views/404.vue'], resolve)
    },
    {
      path: '/403',
      component: resolve => require(['../views/403.vue'], resolve)
    },
    {
      path: '*',
      redirect: '/404'
    }
  ]
})
